public class Singletontest07 {
    static {
        System.out.println("静态内部类! ");
    }

    public static void main(String[] args) throws Exception{
        Singletion07 instance =  Singletion07.getInstance();
        Singletion07 instance2 = Singletion07.getInstance();
        System.out.println(instance == instance2);
        System.out.println(instance.hashCode());
        System.out.println(instance2.hashCode());
    }
}
class Singletion07{
    private static volatile Singletion07 instance;
    private Singletion07(){}
    private static class SingletonInstance{
        private static final Singletion07 INSTANCE=new Singletion07();
    }
    public static synchronized Singletion07 getInstance(){
        return SingletonInstance.INSTANCE;
    }
}